#ifndef BED_H
#define BED_H

#include "MyDialog.h"
#include "SliderDateTime.h"

#include <QDialog>
#include <QWidget>
#include <QMouseEvent>
#include <QTimer>
namespace Ui {
class Bed;
}

class Bed : public MyDialog
{
    Q_OBJECT

public:
    explicit Bed(QWidget *parent = nullptr);
    ~Bed();
    void paintEvent(QPaintEvent *p);
    void setBedAngle(double angle);
    void mousePressEvent(QMouseEvent *event);
    void showControl(cSliderDateTime * &control,QString controlName);
    void hideControl(cSliderDateTime * &control);
public slots:
    void bedCurrentValueChanged(QString currentValue);
    void lightCurrentValueChanged(QString currentValue);
    void siriWork(MyDialogName name,functionFlag flag);
protected:

signals:
    void showSiri_signal();
    //void showPatient_signal(QString str);
    void siriWork_signal(MyDialogName dialogName,functionFlag flag);
private slots:
    void on_over_clicked();


private:
    Ui::Bed *ui;

    bool bedIsActive=false;
    cSliderDateTime* bedControl=nullptr;
    bool lightIsActive=false;
    cSliderDateTime* lightControl=nullptr;
    int controlWight=100;
    int controlHight=200;

    //床参数
    int baseX=540;
    int baseY=400;
    int bedEndLength=200;
    int bedHeadLength=150;
    int bedEndHight=80;
    int HeadHightMoreEnd=60;//床头比床尾高出的高度
    int bedHeadHight=bedEndHight/2+HeadHightMoreEnd;
    double bedHead_DynamicX=baseX-bedHeadLength;
    double bedHead_DynamicY=baseY;

    int pillowLength=40;
    double pillowRightAngleX=baseX-bedHeadLength+pillowLength;
    double pillowRightAngleY=baseY;


    //灯杆参数
    int light_baseLength=50;
    int lightMainPoleLength=280;
    int lightPole1=90;
    int lightPole2=50;
    int lightToBedDistance=300;

    //灯罩参数
    int lightCoverUpLength=60;
    int lightCoverDownLength=80;
    int lightCoverHight=40;

    //灯泡参数
    int lightWidget=20;
    int lightHight=40;
    enum LightStatus{close,half,entire} lightStatus;

};

#endif // BED_H
